﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Tasking.aspx.cs" Inherits="_Default"
    ValidateRequest="false" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!--#include virtual="include/Head.ascx"-->
    <script type='text/javascript' src="assets/js/Country.js"></script>
    <script type="text/javascript" language="javascript">
        var pageno = getUrlVars()["page_number"];
        function doDelete(strID, strAgentName) {
            if (confirm('Bạn có thực sự muốn xóa: ' + strAgentName + '?')) {
                var vnpage = getUrlVars()['page_number'];
                if (vnpage)
                    window.location.href = "Tasking.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    window.location.href = "Tasking.aspx?action=delete&ID=" + strID;
            }
        }
        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
        function openTaskEdit(sID) {

            var url = 'Task.aspx';
            if (sID > 0)
                url += '?id=' + sID;
            //poUpWindow(url);
            //var vnpage = getUrlVars()['page_number'];
            if (pageno && pageno > 1) {
                url += "&page_number=" + pageno;
            }
            window.open(url, 'Task', 'width=800,height=600,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
        }
        function openTaskAdd() {

            var url = 'Task.aspx';
            window.open(url, 'TaskAdd', 'width=800,height=600,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
        }
        $(document).ready(function () {
            searchAndHighlight($('#txtKeyword').val(), "#divContent");
        });
    </script>
    <style type="text/css">
        div.uni-uploader input
        {
            width: 165px;
        }
        .highlighted
        {
            background-color: yellow;
        }
    </style>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                TASKING LIST</h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmCarrContact" runat="server" autocomplete="off">
                <div class="content-box-header">
                    <%if (nPermission > 3)
                                              {%>
                    <a class="button" href="#" onclick="openTaskAdd();">Add New </a>&nbsp; Filter By
                    <%} %>Status:
                    <asp:DropDownList class="cls" ID="drFiterCoding" runat="server" Width="150px" TabIndex="16"
                        AutoPostBack="True" OnSelectedIndexChanged="drFiterCoding_Selected">
                        <asp:ListItem Value="-1">Select</asp:ListItem>
                        <asp:ListItem Value="0">Open</asp:ListItem>
                        <asp:ListItem Value="1">Start</asp:ListItem>
                        <asp:ListItem Value="3">Completed</asp:ListItem>
                        <asp:ListItem Value="2">Not Complete</asp:ListItem>
                        <asp:ListItem Value="4">Closed</asp:ListItem>
                        <asp:ListItem Value="5">Archived</asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="txtKeyword" runat="server" Width="162px" placeholder="Keyword"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Search"
                        Width="74px" CssClass="button" />
                    <div class="clear">
                    </div>
                </div>
                <div id="divContent">
                    <fieldset>
                        <asp:Repeater ID="rptData" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                    <td align="right" style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "Detail")%>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "FileName1")%>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "CreatedDate")%>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "Comment") %>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "FileName2")%>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "LastUpdatedDate")%>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "SourceName") %>
                                    </td>
                                    <td style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "Summary")%>
                                    </td>
                                    <td style="text-align: right;">
                                        <%# DataBinder.Eval(Container.DataItem, "Priority")%>
                                    </td>
                                    <td style="text-align: left;">
                                        <%#GetCodingPeriod(Eval("IsCompleted"))%>
                                    </td>
                                    <%if (nPermission > 0)
                                  {%>
                                    <td align="center" style="text-align: left;">
                                        <%# DataBinder.Eval(Container.DataItem, "Action") %>
                                    </td>
                                    <%} %>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                                    <thead>
                                        <tr style="background: #CCC;">
                                            <th align="center" width="5%">
                                                Index
                                            </th>
                                            <th align="center" width="32%">
                                                Task Name
                                            </th>
                                            <th align="center" width="5%">
                                                Att file
                                            </th>
                                            <th align="center" width="5%">
                                                Date
                                            </th>
                                            <th align="center" width="17%">
                                                Comment
                                            </th>
                                            <th align="center" width="5%">
                                                Att file
                                            </th>
                                            <th align="center" width="5%">
                                                Date
                                            </th>
                                            <th align="center" width="">
                                                Coder
                                            </th>
                                            <th align="center" width="5%">
                                                Timing
                                            </th>
                                            <th align="center" width="5%">
                                                Priority
                                            </th>
                                            <th align="center">
                                                Status
                                            </th>
                                            <%if (nPermission > 0)
                                              {%>
                                            <th align="center" width="6%">
                                                Action
                                            </th>
                                            <%} %>
                                        </tr>
                                    </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                </TABLE>
                            </FooterTemplate>
                        </asp:Repeater>
                    </fieldset>
                </div>
                <div class="clear">
                </div>
                <div id="footer">
                    <%=strPager%>
                </div>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
